package com.weixing.mall.provider.controller.admin;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.model.domain.Agent;
import com.weixing.mall.provider.service.IAgentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("agentWithdraw")
@Api(value = "代理商报表Api",tags = "代理商报表")
public class ReportAgentController extends BaseController {
    @Autowired
    private IAgentService agentService;

    @ApiOperation(value = "报表用户菜单列表，传递参数为结构树节点及ID号")
    @GetMapping("/menuList/{nodeId}")
    public Result MenuList(@PathVariable Long nodeId) {
        List<Agent> list=agentService.list(new QueryWrapper<Agent>().eq("customer_id",nodeId).or().eq("parent_id",nodeId));
        return ResultUtil.success(list);
    }


}
